package base;

import configs.*;
import static configs.Configuracao.gerador;

public class Mutacao {
	
	public static void uniforme(Individuo i)
	{
		int gene = gerador.nextInt(i.caracteristicas.length);
		
		double min = Configuracao.DOMINIO[0];
		double max = Configuracao.DOMINIO[1];

		double mutacao = min + (2* max * gerador.nextDouble());
		
		i.caracteristicas[gene] = mutacao;
	}
	
	public static void gaussiana(Individuo i)
	{
		double min = Configuracao.DOMINIO[0];
		double max = Configuracao.DOMINIO[1];
		
		double desvio = (max - min)/10;

		int posicao = gerador.nextInt(i.caracteristicas.length);
		i.caracteristicas[posicao] += gerador.nextGaussian() * desvio;

	}

}
